import fetch from '../utils/http'
import store from '../store'

export const loginCheck = (phone, password) => fetch('POST', `/api/user/login`, {
  phone: phone,
  password: password
})

/**
 * 获取个人信息接口
 * */
export const getMyPreofile = () => fetch('GET', `/person/${store.state.userInfo.userId}`)

/**
 * 获取当前登录用户的积分
 * */
export const getMyIntegral = () => fetch('GET', `/person/${store.state.userInfo.userId}/integral`)
/** */
export const forgetPassword = (phone, password, registerWay = 'WEBPAGE') => fetch('POST', `/user/forget`, {
  phone: phone,
  password: password,
  registerWay: registerWay
})
